import vue from '@vitejs/plugin-vue'
import components from 'unplugin-vue-components/vite'
import { VarletUIResolver } from 'unplugin-vue-components/resolvers'
import { defineConfig } from 'vite'
import { resolve } from 'path' 


/************************************* 路径配置 start ********************************/


const pathResolve = (dir: string): any => {  
  return resolve(__dirname, ".", dir)          
}

const alias: Record<string, string> = {
  '@': pathResolve("src")
}


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),
    components({
      resolvers: [VarletUIResolver()]
    })],
    resolve: {  // ****************** 路径配置新增
      alias     // ****************** 路径配置新增
    }      
})
